import { createApp } from 'vue'
import { createPinia } from 'pinia'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' // 国际化

import App from './App.vue'
import router from './router'

import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css' // 支持暗色模式
import './assets/styles/index.scss' // 本项目样式

// 这是form-create和form-create-designer需要的依赖，如果不需要可删除
import formCreate from '@form-create/element-ui'
import FcDesigner from '@form-create/designer'

const app = createApp(App)

app.use(createPinia())
app.use(router)

app.use(ElementPlus, {
  locale: zhCn
})

/* 按需载入 */
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(formCreate)
app.use(FcDesigner)

app.mount('#app')
